<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
	<head>
	<link rel="stylesheet" type="text/css" href="CSS/add_form.css" />
	<?
	  require_once('../controller/facebook_sdk/facebook.php');
		$config = array(
    'appId' => '314860265232330',
    'secret' => 'de61791ac4eec6920ab83856c90b7861',
  );
	try{
		$facebook = new Facebook($config);
		$user_id = $facebook->getUser();		
		$user = $facebook->getUser();
		$user_profile = $facebook->api('/me');
		}catch (FacebookApiException $e){
		error_log($e);
		}
		  ?>
	</head>
	<body>
		<div>
			<h2>제품 등록</h2> 
			<form action="../controller/add_controller.php" enctype="multipart/form-data" method="post">
				<table  border=0 cellspacing=0> 
					<tr> 
						<td id ='name'> 제품 사진</td>
						<td> <input type="file" name="product_image" value="찾기" /></td>
					</tr> 
					<tr> 
						
						<td id ='name'>사용자 정보</td> 
						<td><?if($user == null){}
		  else
		  {?>
		  <img src="https://graph.facebook.com/<?php echo $user; ?>/picture" id ='fb_img'>
		  <?}
		  echo $user_profile['name'];?>
							<input type="hidden" name="user_code" value ='<?echo $user.$user_profile['name'];?>' /></td></tr> 
					<tr>
						
						<td id ='name'>제조회사</td> 
						<td><input  type="text"  name="company_name"  size="20" /></td></tr> 
					<tr> 
						
						<td id ='name'> 제품명</td> 
						<td><input  type="text"  name="product_name"  size="20" /></td></tr> 
					
				</table> 
				<h3>상세 설명</h3>
				<textarea rows="10"  name="content"  cols="55"></textarea>
				<input  type="submit" name="submit" value="글작성" />
			</form>				
		</div>
	</body>
</html>
			

			